<?php
class MySQLExtractor implements Extractor {
	
	private static $connection;
	
	private function create() {
		if (!isset($connection)) {
			$configuration = new MySQLConfiguration();
			$host = $configuration->getProperties('host');
			$port = $configuration->getProperties('port');
			
			$username = $configuration->getProperties('username');
			$password = $configuration->getProperties('password');
			
			$connection = mysql_connect($username.':'.$port, $username, $password);
			if (!$connection) die('Could not connect: '.mysql_error());
		}
	}
	
	public function insert(Persistance $persistance) {
		$this->create();
		
		$reflection = new ReflectionClass($persistance);
		
		$persistanceName = $reflection->getName();
		$persistanceProperties = $reflection->getProperties();
		
	}
	
	public function delete(Persistance $persistance) {
		return "delete ".$persistance->getId();
	}

	public function query(Persistance $persistance, Criteria $criteria) {
		return "query";
	}
}
?>